package request

type HandleArgs struct {
	Action string                 `form:"action" json:"action" binding:"required"`
	Args   map[string]interface{} `form:"args" json:"args" binding:"omitempty"`
}

type DispatchArgs struct {
	TaskID                   int            `json:"task_id"`
	DeliveryConcreteCategory string         `json:"delivery_concrete_category"`
	RemainConcreteCategory   string         `json:"remain_concrete_category"`
	VehicleCapacity          float64        `json:"vehicle_capacity"`
	BuildPosition            string         `json:"build_position"`
	Remark                   string         `json:"remark,omitempty"`
	ProjectSubName           string         `json:"project_sub_name"`
	VehicleID                int            `json:"vehicle_id"`
	VehicleNo                string         `json:"vehicle_no"`
	VehicleContacts          string         `json:"vehicle_contacts"`
	Items                    []DispatchItem `json:"items,omitempty"`
	IsCancelBefore           int            `json:"is_cancel_before"`
}

type DispatchItem struct {
	Key              int     `json:"key"`
	MixerNo          string  `json:"mixer_no"`
	ConcreteQuantity float64 `json:"concrete_quantity"`
	ReturnQuantity   float64 `json:"return_quantity"`
	MortarQuantity   float64 `json:"mortar_quantity"`
	DeliveryQuantity float64 `json:"delivery_quantity"`
	CountVehicle     int     `json:"count_vehicle"`
	CountQuantity    float64 `json:"count_quantity"`
	IsWater          int     `json:"is_water"`
	RemainQuantity   int     `json:"remain_quantity"`
}

func (handleArgs HandleArgs) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"action.required": "操作类型不能为空",
	}
}
